<?php
	$snumber = $_REQUEST["snumber"];
	$spass = $_REQUEST["spass"];
	if($spass){
		$flag = 1;
		$conn = mysqli_connect("localhost:3306","mebin","171110301cwb","sms");
		$sql = " update student_roll set spass='{$spass}' where snumber='{$snumber}' ";
		$result = mysqli_query($conn, $sql);
		if(mysqli_errno($conn)){
			$flag = 0;
			echo mysqli_error($conn);
		}
		mysqli_close($conn);
		if($flag){
?>
			<script>
				alert("修改成功,可进行学生功能模块操作。。。");
			</script>
<?php
		}
		else{
?>
			<script>
				alert("修改失败。。。");
			</script>
<?php
		}
	}else{
?>
		<script>
			alert("请先输入密码");
			location.href = 'Stu_updatepass.php';
		</script>
<?php
	}
?>